package com.bytedance.improvingroad

import android.widget.ListView
import com.bytedance.improvingroad.activity.*
import com.bytedance.improvingroad.activity.TestActivity
import com.bytedance.improvingroad.adapter.RootListAdapter
import com.bytedance.improvingroad.binder.client.ClientActivity
import com.bytedance.improvingroad.scroll_conflict.DispatchConflictActivity
import com.google.android.material.datepicker.MaterialDatePicker

class MainActivity : BaseActivity() {
    private lateinit var rootList: ListView

    @Volatile
    var i = 0
    private val titleList = mutableListOf(
        "RecyclerView测试", "随便测界面", "脉脉卡片demo", "Material Design","Banner测试",
    "Banner花式show","Binder测试", "BottomAppBar测试","TopAppBar测试","BottomNavigation测试"
    ,"Card布局测试","Chip测试","抽屉布局测试","底部抽屉测试","轻控件测试界面","BottomSheet测试"
    ,"滑动事件冲突","随便测试2","嵌套滑动机制探讨","CoordinatorLayout测试","自定义PhotoView")
      override fun init() {
        rootList = findViewById(R.id.root_list)

        rootList.adapter = RootListAdapter(titleList)
        rootList.setOnItemClickListener { adapterView, view, position, p3 ->
            when(position) {
                0 -> startActivity<RvActivity>()
                1 -> startActivity<TestActivity>()
                2 -> startActivity<SlideCardActivity>()
                3 -> startActivityAndFinish<MDActivity>()
                4 -> startActivityAndFinish<BannerActivity>()
                5 -> startActivityAndFinish<BannerShowActivity>()
                6 -> startActivityAndFinish<ClientActivity>()
                7 -> startActivityAndFinish<BottomAppBarActivity>()
                8 -> startActivityAndFinish<TopAppBarActivity>()
                9 -> startActivityAndFinish<BottomNavActivity>()
                10-> startActivityAndFinish<CardActivity>()
                11-> startActivityAndFinish<ChipActivity>()
                12-> startActivityAndFinish<DrawerActivity>()
                13-> startActivityAndFinish<BottomDrawerActivity>()
                14-> startActivityAndFinish<LightWidgetActivity>()
                15-> startActivityAndFinish<BottomSheetActivity>()
                16-> startActivityAndFinish<DispatchConflictActivity>()
                17-> startActivityAndFinish<Test3Activity>()
                18-> startActivityAndFinish<NestedTestActivity>()
                19-> startActivityAndFinish<CoordinatorActivity>()
                20-> startActivityAndFinish<DefinePhotoViewActivity>()
            }
        }
      }

     override fun getLayoutId() = R.layout.activity_main


}